package com.lwm.reflection;

import org.junit.Test;

import java.util.stream.Stream;

/**
 * @author liweimin
 * @date 2020/9/17 9:16
 * @description
 */
public class demotest {
    public static void main(String[] args) {
        System.out.println("fjkls");
    }
    @Test
    public void test(){
        String s = "1|2|2 3 1||4";
        String[] split = s.split("\\|");
        for (String s1 : split) {
            System.out.println(s1+"长度为："+s1.length());
        }
    }
    @Test
    public void test01(){
        String s = "1|2|gsdg3|fgh|hf4|asd|hfgh|ds|hdfgh|dasdds|hfghhfjhvsaohifosida123 f4f54  好覅速度发货 怕佛教啊是的放假" +
                "发上来的那份 法接受的了 **%……￥%…………*……*……&*……&%h|";
        Stream<String> split = Stream.of(s.split("\\|"));
        System.out.println(split.max(String::compareTo).get().length());
    }
}
